home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 November / PCWNOV07.iso / Software / Trial / AceHTML Pro 6.6 / acehtml6pro.exe / scriptdef / BG Color Adjuster.sd < prev    next >
Encoding:
INI File  |  2006-09-13  |  2.2 KB  |  71 lines

  1. [SUBJECT]
  2. Description=Adjust the background color
  3. ImageIndex=-1
  4. Folder=Tools
  5.  
  6.  
  7. [HEAD_TEXT]
  8. ;<!-- Original:  Dion (yobo42@hotmail.com) -->
  9. ;<!-- Web Site:  http://yoboseyo42.virtualave.net -->
  10. ;<!-- This script and many more are available free online at -->
  11. ;<!-- The JavaScript Source! http://javascript.internet.com -->
  12. ;
  13. ;<script language="JavaScript">
  14. ;
  15. ;<!-- Begin
  16. ;function color(frm, clr, val) {
  17. ;v = eval("0x" + frm[clr].value) + val;
  18. ;if (v < 0 || v > 255) v -= val;
  19. ;v = v.toString(16).toUpperCase();
  20. ;while (v.length < 2) v = "0" + v;
  21. ;frm[clr].value = v; nc = "";
  22. ;for(i = 1; i < 8; i += 3) nc += frm.elements[i].value;
  23. ;document.bgColor = nc;
  24. ;}
  25. ;function setval(myitem) {
  26. ;v = prompt("New value for " + myitem.name + " (00 - FF)", myitem.value);
  27. ;if (v) {
  28. ;v = eval("0x" + v);
  29. ;if ((v & 255) == v) {
  30. ;myitem.value=v.toString(16).toUpperCase();
  31. ;while (myitem.value.length < 2) myitem.value = "0" + myitem.value;
  32. ;color(document.f, myitem.name, 0);
  33. ;      }
  34. ;   }
  35. ;}
  36. ;//  End -->
  37. ;</script>
  38. ;
  39.  
  40.  
  41.  
  42. [BODY_TEXT]
  43. ;
  44. ;<div align="center">
  45. ;<form name="f">
  46. ;<table border="1" summary="">
  47. ;<tr>
  48. ;<td colspan="3" align="center" bgcolor="#ff0000">RED</td>
  49. ;<td colspan="3" align="center" bgcolor="#00ff00">GREEN</td>
  50. ;<td colspan="3" align="center" bgcolor="#000ff">BLUE</td>
  51. ;</tr>
  52. ;<tr>
  53. ;<td><input type="button" name="rm" value="<" onclick = "color(this.form, 'Red' , -1);"></td>
  54. ;<td><input type="button" name="Red" value="AF" onclick = "setval(this);"></td>
  55. ;<td><input type="button" name="rp" value=">" onclick = "color(this.form, 'Red', 1);"></td>
  56. ;<td><input type="button" name="gm" value="<" onclick = "color(this.form, 'Green', -1);"></td>
  57. ;<td><input type="button" name="Green" value="BF" onclick = "setval(this);"></td>
  58. ;<td><input type="button" name="gp" value=">" onclick = "color(this.form, 'Green', 1);"></td>
  59. ;<td><input type="button" name="bm" value="<" onclick = "color(this.form, 'Blue', -1);"></td>
  60. ;<td><input type="button" name="Blue" value="CF" onclick = "setval(this);"></td>
  61. ;<td><input type="button" name="bp" value=">" onclick = "color(this.form, 'Blue', 1);"></td>
  62. ;</tr>
  63. ;</table>
  64. ;</form>
  65. ;</div>
  66. ;
  67.  
  68.  
  69.  
  70.  
  71.